package com.sunny.ynhz.utils;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

/**
 * Created by Administrator on 2016/9/9.
 */
public class AppVersionUtils {

    public static String getVersion(Context context) {
        PackageInfo info = null;
        PackageManager manager;
        manager = context.getPackageManager();
        try {
            info = manager.getPackageInfo(context.getPackageName(), 0);

        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        return info.versionName;


    }

}
